<template>
    <div class="ej_nav_box">
        <div class="erji_left_nav">
            <div class="zdgk_fl">
                <div class="zdgk_fl_titel">
                    高级搜索
                </div>
                <el-form ref="form" :model="formdata" label-width="80px">
                <div class="zdgk_fl_nr">
                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">所属类别:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-select style="width:100%" v-model="formdata.columnId" placeholder="请选择">
                                <el-option v-for="item in options" :label="item.label" :value="item.value"></el-option>
                            </el-select>
                        </div>
                    </div>

                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">所属单位:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-select style="width:100%" v-model="formdata.organization" placeholder="请选择">
                                <el-option v-for="item in options2" :label="item.label" :value="item.value"></el-option>
                            </el-select>
                        </div>
                    </div>

                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">投&nbsp;稿 &nbsp;人:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-input v-model="formdata.postedBy"></el-input>
                        </div>
                    </div>
                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">作 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 者:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-input v-model="formdata.author"></el-input>
                        </div>
                    </div>
                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">文章标题:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-input v-model="formdata.title"></el-input>
                        </div>
                    </div>
                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">文章内容:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-input v-model="formdata.content"></el-input>
                        </div>
                    </div>

                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">起始时间:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-date-picker
                            style="width:100%"
      v-model="formdata.beginTime"
      value-format="yyyy-MM-dd HH:ss:mm"
      format="yyyy-MM-dd HH:ss:mm"
      type="date"
      placeholder="选择日期">
    </el-date-picker>
                            <!-- <el-input v-model=""></el-input> -->
                        </div>
                    </div>
                    <div class="zdgk_fl_nr_li">
                        <div class="zdgk_fl_nrfl">终止时间:</div>
                        <div class="zdgk_fl_nrfr">
                            <el-date-picker
                            style="width:100%"
      v-model="formdata.endTime"
      value-format="yyyy-MM-dd HH:ss:mm"
      format="yyyy-MM-dd HH:ss:mm"
      type="date"
      placeholder="选择日期">
    </el-date-picker>
                            <!-- <el-input v-model="formdata.endTime"></el-input> -->
                        </div>
                    </div>

                    <div class="zdgk_fl_nr_liss">
                        <el-button @click="search">搜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;索</el-button>
                    </div>
                </div>
            </el-form>
            </div>

        </div>


    </div>
</template>
<script>
import { columnAdd, columnqueryAll, columndelete, contentApiqueryPage, contentApidelete, approval } from "@/api/webpage";
import { organizationApiqueryAll} from "@/api/organizationApir";
export default {
    name: "SeniorSearch",
    props:{
        formdata:{
            type:Object,
            default:{}
        }
    },
    data() {
        return {
            // formdata:{
            //     title:'',
            //     columnId:'',
            //     content:'',
            //     author:'',
            //     postedBy:'',
            //     organization:'',
            //     coreUnit:'',
            //     beginTime:'',
            //     endTime:'',
            // },
            options:[],
            options2:[],
           
        };
    },
    created() {
        this.getoptions()
    },
    methods: {
        search(){
            this.formdata.pageNum= 1
            this.formdata.pageSize= 10
            this.$emit('search',this.formdata)
        },
        getoptions() {
            let data = {
                name: "",
                code: "",
                parentId: '',
                showQuery:'1'
            };
            columnqueryAll(data).then((res) => {
                if (res.code == 0) {
                this.options = res.data.map(item => {
                    return { label: item.name, value: item.id }
                });
                }
            });
            let params ={
                name: '',
                parentId: '',
            }
            organizationApiqueryAll(params).then((res) => {
                if (res.code == 0) {
                    this.options2 = res.data.map(item => {
                        return { label: item.name, value: item.id }
                    });
                }
            });
       },
    },
};
</script>
<style scoped>
    .zdgk_fl_nr_liss .el-button{
        width: 100%;
        height:38px;
        background: #047adb;
        padding: 0;
    }
    /* .zdgk_fl_nrfr .el-input--suffix .el-input__inner{
        padding: 0 !important;
    } */
</style>